package com.kx.game.center.api.instances;

import com.kx.game.center.api.GameCenterApi;
import com.kx.game.center.api.IConfig;
import com.kx.game.center.api.IGameCenterRequest;
import com.kx.game.center.api.IGameCenterResponse;

/**
 * 游戏中心服务器
 * 
 * @author wenji.fan
 * @since 2013-8-15
 * 
 */
public class GameCenter implements GameCenterApi {

	private IConfig config = new DefaultConfig();

	@Override
	public IConfig getConfig() {
		return config;
	}

	public void setConfig(IConfig config) {
		this.config = config;
	}

	@Override
	public <T extends IGameCenterResponse> T sendRequest(
			IGameCenterRequest<T> request) {
		request.setConfig(config);
		T t = request.send();
		return t;
	}

}
